﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO.IsolatedStorage;
using System.IO;

namespace FileStreamsAndCrypto
{
    class IsolatedStorageDateTime
    {
        //static void Main()
        //{
        //    IsolatedStorageFile userStorage = IsolatedStorageFile.GetUserStoreForAssembly();
        //    using (userStorage)
        //    {
        //        IsolatedStorageFileStream stream =
        //            new IsolatedStorageFileStream("example.txt", FileMode.OpenOrCreate, userStorage);
        //        using (stream)
        //        {
        //            // Read the isolated storage file contents
        //            TextReader reader = new StreamReader(stream);
        //            string fileContents = reader.ReadToEnd();
        //            Console.WriteLine("Current file contents: {0}", fileContents);

        //            // Modify the isolated storage file contents
        //            Console.WriteLine("The file Contents will be changed to {0}:", DateTime.Now);
        //            Console.Write("Write something personal to store: ");
        //            string newFileContents = DateTime.Now.ToString() + System.Environment.NewLine + Console.ReadLine();
        //            stream.SetLength(0);
        //            TextWriter writer = new StreamWriter(stream);
        //            using (writer)
        //            {
        //                writer.Write(newFileContents);
        //            }
        //        }
        //    }
        //}
    }
}
